<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js"></script>
</head>
<style>
    img{
        width: 200px;
    }
</style>
<body>
    <p id="name"></p>
    <img src="" alt="" id="img">
    <p id="detail"></p>
    <script>
        var url = `http://47.108.197.28:3000/top/playlist`;
        $.ajax({
            url,
            success:res=>{
                var {name,id,coverImgUrl}  = res.playlists[0];
                $("#name").html(name);
                $("img").attr("src",coverImgUrl)
                // 获取歌曲详情相关数据
                var url = `http://47.108.197.28:3000/top/playlist?id=${id}`
                $.ajax({
                    url,
                    success:res=>{
                        console.log((res.playlists[0].description));
                        var detail = res.playlists[0].description;
                        $("#detail").html(detail)
                    }
                })
            }
        })
    </script>
</body>

</html>